<?php
class Manager_SiteConfig
{
	const SITE_NAME 	= 'pcunited';
	const SITE_TITLE 	= 'titile';
	const SITE_URL		= 'http://localhost/~paq/pcunited';
	const ADMIN_EMAIL	= 'admin@email.com';
	
	public static function initialize()
	{		
		if (SiteconfigsPeer::doCount(new Criteria()) === 0) {		
			try {
				$config = new Siteconfigs();
				$config->setSitename(self::SITE_NAME)
					->setSitetitle(self::SITE_TITLE)
					->setAdminemail(self::ADMIN_EMAIL);
				$config->save();
			} catch (Exception $e) {
				throw new Exception('Site config could not be initialized in the DB. ' . $e->getMessage());
			}
		}
	}
}